<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    {% block title %}<title>计算机学习笔记</title>{% endblock %}
    <meta name="baidu-site-verification" content="oWXIYfP7Us"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="{{ url_for('static',filename='favicon.ico') }}">
    <link href="{{ url_for('static',filename='home/css/base.css') }}" rel="stylesheet">
    <link href="{{ url_for('static',filename='home/css/index.css') }}" rel="stylesheet">
    <link href="{{ url_for('static',filename='home/css/m.css') }}" rel="stylesheet">
    <link href="{{ url_for('static',filename='home/font-awesome-4.7.0/css/font-awesome.min.css') }}" rel="stylesheet">
</head>

<body>
<header>
    <!--菜单栏-->
    <div class="menu">
        <nav class="nav" id="topnav">
            <h1 class="logo"><a href="{{ url_for('home.index') }}">计算机学习笔记</a></h1>
            <li>
                <a href="{{ url_for('home.index') }}" class="active">首页</a>
            </li>

            <li>
                <a href="{{ url_for('home.show_first_cate',keyword='work',page=1) }}">学无止境</a>
                <ul class="sub-nav" id="work_cate">
                    <!--ajax填充-->
                </ul>
            </li>
            <li>
                <a href="{{ url_for('home.show_first_cate',keyword='life',page=1) }}">慢生活</a>
                <ul class="sub-nav" id="life_cate">
                    <!--ajax填充-->
                </ul>
            </li>
            <li>
                <a href="{{ url_for('home.time_line') }}">时间轴</a>
            </li>
            <li>
                <a href="{{ url_for('home.about_me') }}">关于我</a>
            </li>
            <!--search begin-->
            <div id="search_bar" class="search_bar">
                <form id="searchform" action="{{ url_for('home.search') }}" method="get" name="searchform">
                    <input class="input" placeholder="想搜点什么呢..." type="text" name="keyboard" id="keyboard">
                    <input type="hidden" name="Submit" value="搜索"/>
                    <span class="search_ico"></span>
                </form>
            </div>
            <!--search end-->
        </nav>
    </div>
    <!--mnav begin-->
    <div id="mnav">
        <h2><a href="{{ url_for('home.index') }}" class="mlogo">菜鸟成长记</a><span class="navicon"></span></h2>
        <dl class="list_dl">
            <dt class="list_dt"><a href="{{ url_for('home.index') }}">网站首页</a></dt>
            <dt class="list_dt"><a href="{{ url_for('home.show_first_cate',keyword='work',page=1) }}">学无止境</a></dt>
            <dd class="list_dd">
                <ul id="work_cate_2">

                </ul>
            </dd>
            <dt class="list_dt"><a href="{{ url_for('home.show_first_cate',keyword='life',page=1) }}">慢生活</a></dt>
            <dd class="list_dd">
                <ul id="life_cate_2">

                </ul>
            </dd>
            <dt class="list_dt"><a href="{{ url_for('home.time_line') }}">时间轴</a></dt>
            <dt class="list_dt"><a href="{{ url_for('home.about_me') }}">关于我</a></dt>
        </dl>
    </div>
    <!--mnav end-->
</header>

<article>
    {% block daohang %}

    {% endblock %}

    <!--轮播图-->
    {% block banner_left %}

    {% endblock %}

    <!--輪播圖右二-->
    {% block banner_right %}

    {% endblock %}


    <!--博客列表/正文-->
    {% block posts_list %}   {% endblock %}

    <!--侧边栏-->
    <div class="sidebar">
        {% block sidebar %}

        {% endblock %}
        <div class="guanzhu" id="follow-us">
            <h2 class="hometitle">联系我</h2>
            <ul>
                <li class="wx"><img src="{{ url_for('static',filename='home/images/wx.jpg') }}"></li>
            </ul>
        </div>
    </div>
</article>

<!--footer-->
<footer>
    {% block footer %}
        <!--底部个人信息-->
        <p>
            <a href="javascript:">Ted 版权所有 </a> |
            <a href="javascript:">基于Flask构建 </a> |
            <a href="https://cloud.tencent.com/redirect.php?redirect=1014&cps_key=9fbe633bfe2076b4955a29429e28514d&from=console"
               target="_blank">©2019托管于腾讯云主机</a> |
            <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=51070302110398" target="_blank">蜀ICP备19010009号</a>|
            <a href="{{ url_for('auth.login') }}">管理登录</a>
        </p>
        <a href="#" class="cd-top">Top</a>
        <script src="{{ url_for('static',filename='home/js/jquery.min.js') }}" type="text/javascript"></script>
        <script src="{{ url_for('static',filename='home/js/jquery.easyfader.min.js') }}"></script>
        <script src="{{ url_for('static',filename='home/js/scrollReveal.js') }}"></script>
        <script src="{{ url_for('static',filename='home/js/common.js') }}"></script>
        <script>
            var work_category = {{ url_for('home.work_category') }};
            var life_category = {{ url_for('home.life_category') }};
            $(document).ready(function () {
                $.ajax({
                    url: work_category,
                    type: 'GET',
                    success: function (data) {
                        {#console.log(data);#}
                        var str = '';
                        $.each(data, function (i, item) {
                            str += '<li><a href="/posts/cate/' + item.id + '/1">' + item.name + '</a>';
                            str += '</li>';
                            {#console.log(str);#}
                        });
                        $("#work_cate").html(str);
                        $("#work_cate_2").html(str);
                    },
                    error: function () {
                    }
                });

                $.ajax({
                    url: life_category,
                    type: 'GET',
                    success: function (data) {
                        {#console.log(data);#}
                        var str = '';
                        $.each(data, function (i, item) {
                            str += '<li><a href="/posts/cate/' + item.id + '/1">' + item.name + '</a>';
                            str += '</li>';
                            {#console.log(str);#}
                        });
                        $("#life_cate").html(str);
                        $("#life_cate_2").html(str);
                    },
                    error: function () {
                    }
                });
            })
        </script>
    {% endblock %}
</footer>

{% block js %}

{% endblock %}

</body>

</html>
